<template>

    <div class="htmlBox">
      <h1 align="center"> {{msg}}:{{btnMsg}}</h1>

    </div>
</template>

<script>
    export default {
        name: "PayReturn",
      data(){
          return{
            msg:"",
            btnMsg:"跳转到订单页面",
            totalTime:5,
          }
      },
      mounted() {
          var fulPath=this.$route.fullPath;//获取全路径
          var uri=fulPath.split("?")[1];
          this.$http.get("/payLog/checkSign?"+uri).then((res)=>{
            this.msg=res.data.message;

          })
        var iv=window.setInterval(()=> {
          var time = this.totalTime--;
          this.btnMsg = time + "后跳转";
          if (time <= 0) {
            //停止执行
            window.clearInterval(iv);
            this.totalTime = 60;
            this.btnMsg = "跳转到订单页面";
            this.$router.push("cusOrder");
          }
        },1000);
      }
    }
</script>

<style scoped>
  .htmlBox{
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0px;
    background-color: #d9d9d9;
  }
</style>
